<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<input type="button" value="修改性别" id="btn">
<input type="radio" value="1" name="sex">男
<input type="radio" value="2" name="sex" id="rad1">女
<input type="radio" value="3" name="sex">保密
<script>
    function my$(id) {
        return document.getElementById(id);
    }

    my$("btn").onclick = function () {
        my$("rad1").checked = true;
    };
</script>
<br>
<br>
<input type="button" value="选择兴趣" id="btn1">
<input type="checkbox" name="xingqu" value="1">吃饭
<input type="checkbox" name="xingqu" value="2">睡觉
<input type="checkbox" name="xingqu" value="3" id="ck1">打豆豆
<input type="checkbox" name="xingqu" value="4">打篮球
<input type="checkbox" name="xingqu" value="5" id="ck2">打足球
<input type="checkbox" name="xingqu" value="5">打铅球
<script>1
my$("btn1").onclick = function () {
    my$("ck1").checked = true;
    my$("ck2").checked = true;
};

</script>
</body>
</html>